<template>
  <van-nav-bar
    :title="$route.meta.title"
    left-text="返回"
    @click-left="onClickNavBarLeft"
    @click-right="onClickNavBarRight"
    left-arrow
  >
    <template slot="right"><slot class="glabal-nav-bar-msg" name="img"/></template>
  </van-nav-bar>
</template>

<script>
  import { NavBar } from 'vant';

  export default {
    name: 'global-nav-bar',
    components: {
      [NavBar.name]: NavBar
    },
    methods: {
      onClickNavBarRight() {
        this.$router.push({name: 'noticeIndex'})
      },
      onClickNavBarLeft() {
        this.$router.go(-1);
      }
    }
  }
</script>
